<?php
namespace app\yyq\controller;

use app\admin\model\Activity;
use app\admin\model\CampList;
use app\admin\model\Search;
use app\admin\model\SearchType;
use think\Controller;
use think\Db;

class Recommend extends Controller
{

    public function recommend()
    {
        $where['state'] = 1;
        // 查询营地榜单
        $campList = CampList::where($where)->select();
        // 查询热门活动循环图片
        $activity = Activity::where($where)->limit(1,4)->select();
        // 查询推荐表
        $search = Search::where($where)->select();
        // 查询推荐分类
        $search_type = SearchType::where($where)->select();
        return $this->fetch('recommend',$this->getCommonData()
            +[
                'search' => $search,
                'search_type' => $search_type,
                'activity' => $activity,
                'campList' => $campList,
            ]
        );
    }
}